This application claims the priority of German patent document 197 18 041.8, filed Apr. 29, 1997, the disclosure of which is expressly incorporated by reference herein.
The present invention relates to a method and apparatus for testing the contacting of a switch or pushbutton in a d.c. circuit
In place of power switches, it is known to use switches whose switch position is read in through a controller. Such switches are connected with an input (which may be an I/O port) of the controller. The I/O port is used only as an input, by connecting this port to the switch. It is also known to connect analog switches, for example, to an input of a controller in the form of an A/D converter. In order to determined whether all such switches of a given device have been installed and are functioning properly, it is necessary to test the switches manually. The tester is guided by interactive test programs to ensure that all the switches are checked.
Particularly in production (in the automobile industry or the electronics industry, for example), there is frequently a requirement to check finished products to determine whether all the switches have been installed in the product in accordance with a predetermined product specification.
German patent document DE 37 24 926 A1 discloses a circuit in which a switch or sensor that is open in the resting position is checked by connecting a resistance in parallel with it. On the basis of a differently-set voltage level based on the resistance ratios to other resistances connected in parallel and in series, various contacting errors and/or functional problems in the switch or sensor can be detected. In order to avoid a continuous current through this resistance, a controllable switch is wired in series with it, which is closed only when a check is to be performed.
The object of the present invention is to provide a method and apparatus which simplify checking of the correct contacting of a switch or pushbutton in a circuit supplied with direct current.
This and other objects and advantages are achieved by the testing circuit and method according to the invention for checking the correct contacting of a switch or pushbutton in a circuit supplied with direct current, which is connectable alternatively with at least one input and at least one output of a controller or microprocessor. According to the invention, a capacitor arrangement (which may be a single capacitor) is connected in parallel with the switching section of the switch or pushbutton. This capacitor arrangement prevents the flow of a direct current when the switch or pushbutton is not actuated. Therefore, no additional measures need be taken (such as disconnection by means of a controllable switch, for example) in order to avoid continuous current flow and resultant discharge of a battery of a vehicle.
With this circuit, testing the contacting, or checking whether the switch or pushbutton is in fact installed, can be performed without actuating the pushbutton or switch. It is therefore also possible to check the contacting automatically.
The switch or pushbutton can be connected for example to an I/O port. According to the invention, this port is not used simply as an input, but is switched between the input and the output in order to change the signal level for checking. (It is also possible, of course, to connect the switch or pushbutton with different ports, of which at least one is an input and at least one other is an output.) In this way, the time variation of the signal following a change in level can be evaluated. Because of the RC element, there is a delayed increase in signal level if the contacting is correct.
In one embodiment of the invention, a switch or pushbutton is designed as a two-way switch or two-way pushbutton, one ouput of which is connected directly to a fixed potential, the other being connected to the same fixed potential through the capacitor system referred to previously. With this design of the circuit, discharging of the capacitor every time the switch or pushbutton is activated is avoided. (That is, otherwise, after the switch or pushbutton has been disconnected, the capacitor would then be recharged, resulting in greater energy consumption.) This design also avoids a situation in which, when the switch or pushbutton is activated, the capacitor must first be discharged until the change in signal level can be detected by the controller. This in turn would result in a time delay.
In another embodiment of the invention a coil arrangement is provided in the lead of the switch or pushbutton. In a circuit of this type, contacting of a switch or pushbutton can be checked in the actuated state, the time variation of the signal level being evaluated after the signal level has been changed by an output of the controller or microprocessor, such signal level corresponding to the signal level in the switch or pushbutton when it is being actuated.
In an advantageous embodiment, a capacitor system is connected parallel to the lead of the switch or pushbutton. As a result, a check can be performed independently of whether the switch or pushbutton is being actuated. When the signal level changes as a result of the output of the controller or microprocessor, a certain behavior of the signal level with time is established.
In another embodiment of the invention, a circuit or pushbutton is designed as a two-way switch or two-way pushbutton, one of whose leads is connected through a coil arrangement with a certain potential and whose other lead is connected by a capacitor arrangement with the given potential. As a result, a situation can be avoided in which, when a switch or pushbutton is actuated, a declining, oscillating behavior results. Thus, a certain signal level always becomes established after a certain delay.
In still another embodiment of the invention, the input and output of the controller or microprocessor comprise an I/O port, so that the switches or pushbuttons need be connected only with a single terminal of the controller or microprocessor.
In yet another embodiment, the input and output of the controller or microprocessor can be activated in different ways and with corresponding staggering, timewise. As a consequence it is also possible, for example, to check an analog switch connected with an A/D converter.
In another embodiment the circuit or pushbutton initially is connected at least with the output, with a signal level then being output that corresponds to the signal level at the input in the case of correct contacting and actuating of the switch or pushbutton, and with the switch or pushbutton, following the change in signal level, being connected at least with the input, whereupon the signal level is evaluated. In this way, the switch or pushbutton can be tested easily. The signal level emitted from the output then depends on whether the switch or pushbutton connects the input with ground or with another potential.
In a further embodiment of the invention correct contacting is checked in a simple fashion by means of the time variation of the signal level.
Further, the behavior with time can be evaluated, with at least one characteristic point in time of the signal level being compared with a certain threshold value. In the this way, the behavior with time can be evaluated without great expense.
In the method according to the invention, one of the above circuits is used for testing the correct contacting of a switch or pushbutton, with a signal level being output during operation at a known level that can be attributed to actuation of the switch or pushbutton. Such signal level corresponds to the signal level at the input when there is correct contacting and actuation of the switch or pushbutton, and the output is then deactivated; it is then determined from the subsequent time variation of the signal level whether actuation of the switch or pushbutton has occurred. In this manner, actuation of the switch or pushbutton can advantageously be distinguished from an error situation such as grounding of the lead. The signal evaluation can then be considerably improved as far as safety is concerned.
Also, with one of the above circuits, or one of the above methods, the cost of checking can be significantly reduced.
With the method and apparatus according to the invention, switches or pushbuttons can be checked as often as desired, and at any time, without the need for manual actuation, by calling up a software test routine. The test computer is used only to start the test routines and to read out the error memory/status bits.
Other objects, advantages and novel features of the present invention will become apparent from the following detailed description of the invention when considered in conjunction with the accompanying drawings.